home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_14_inf_cinematic_trap.cog < prev    next >
Text File  |  1999-11-15  |  36KB  |  1,094 lines

  1. # Jones 3D Cog Script
  2. #
  3. # 14_INF_Cinematic_Trap.cog
  4. #
  5. # Turner traps Sophia in a mystery cage before Indy can intervene
  6. #
  7. # [HB & SXC]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ==============================================================================
  12.  
  13. symbols
  14.  
  15. # .................................. MESSAGES ..................................
  16.  
  17.     message        startup
  18.     message        activated
  19.     message        callback
  20.     message        pulse
  21.  
  22. # .................................. KEYFRAMES .................................
  23.     
  24.     keyframe    in_armsCrossed=0in_stand2.key            local
  25.     keyframe    in_handsONhips=0in_stand4.key            local
  26.     keyframe    in_crossArms=0in_stand1_bd_2.key           local
  27.     keyframe    in_handsTOhips=0in_stand1_bd_4.key           local # 26x
  28.     keyframe    in_rtarmup=0in_armsout_1_1.key            local
  29.     keyframe    in_botharmsup=0in_armsup_1_1.key        local
  30.     keyframe    in_hatpush=0in_figithat_4_4.key            local
  31.     keyframe    in_activate=in_activate_medium.key        local
  32.     keyframe    in_stop=0in_stop_1_1.key                local
  33.     keyframe    in_gunout=in_attack_pull_gun.key        local # marked x5/cb28
  34.     keyframe    in_gunaway=in_attack_put_gun.key        local # marked x15/cb29
  35.  
  36.     keyframe    so_turn=0so_lookright_2_2.key            local
  37.     keyframe    so_lthandup=0so_lefthnd_2_2.key            local        
  38.     keyframe    so_handsONhips=0so_stand1.key            local
  39.     keyframe    so_hair=0so_hair_2_2.key                   local
  40.     keyframe    so_lookleft=0so_lookleft_2_1.key        local
  41.     keyframe    so_plunge=0so_fallfwd_1_spin.key        local
  42.  
  43.     keyframe    tu_handsATside=0tu_stand3.key            local        
  44.     keyframe    tu_placeimp=0tu_placebox_3_3.key        local # marked x60/cb16
  45.     keyframe    tu_leverpull=0tu_pulleverL_3_3.key        local
  46.     keyframe    tu_leverfutz=0tu_pushlevers_3_3.key        local
  47.     keyframe    tu_sleeve=0tu_forgetivory_3_3.key        local # probably temp
  48.     keyframe    tu_rthand=0tu_righthnd_3_1.key            local
  49.     keyframe    tu_rthand_1_1=0tu_righthnd_1_1.key        local
  50.     keyframe    tu_botharmsup=0tu_armsup_1_3.key        local
  51.     keyframe    tu_handsONhips=0tu_stand1.key            local
  52.     keyframe    tu_pushsophia=0tu_pushsophia_1.key        local
  53.     
  54.     keyframe    lv_leverpullL=levers_pulleverL_3_3.key    local
  55.     keyframe    lv_leverfutz=levers_pushlevers_3_3.key    local
  56.  
  57. # .................................. MODELS ....................................
  58.         
  59.     model          mod_tu_imp2=hand_tu_imp2.3do            local
  60.     model        mod_tu_imp2RT=imp2_invis.3do            local
  61.     model       imp2_invis_on=imp2_invis_inv_on.3do     local
  62.             
  63. # .................................. SOUNDS ....................................
  64.  
  65.     sound        in_whistle=Inxj006.wav                    local
  66.     sound        in_whathere=Inxj005.wav                    local
  67.     sound        tu_worldbeckons=Im03t01.wav                local
  68.     sound        so_dontbefool=Im03s02.wav                local
  69.     sound        in_heytwo=Im03j03c.wav                    local
  70.     sound        tu_jonesout=Im03t04.wav                    local
  71.     sound        tu_knowlimit=Im03t05.wav                local
  72.     sound        so_lookcrazy=Im03s06.wav                local
  73.     sound        tu_lookdiplomat=Im03t07.wav                local
  74.     sound        so_ahhh=Im03s08.wav                        local
  75.     sound        tu_goldminea=Im03t09a.wav                local
  76.     sound        tu_goldmineb=Im03t09b.wav                local
  77.     sound        in_whyhelpthief=Im03j10.wav                local
  78.     sound        tu_namefreedom=Im03t11.wav                local
  79.     sound        in_howsthisa=Im03j12a.wav                local
  80.     sound        in_howsthisb=Im03j12b.wav                local
  81.     sound        tu_forgetivory=Im03t13c.wav                local
  82.     sound        in_letsvote=Im03j14c.wav                local
  83.     sound        so_nooo=Im03s15.wav                        local
  84.     sound        in_comeback=Im03j16.wav                    local
  85.     sound        tu_seeyoulater=Im03t17.wav                local
  86.     sound        so_indeee=Im03s18.wav                    local
  87.     sound        in_dontworry=Im03j19.wav                local
  88.     sound        in_ihope=Im03j20.wav                    local
  89.     sound       imppartplace=aet_gem_place.wav          local
  90.     sound       imppartpowup=imp2_powerup.wav           local
  91.     sound       imppartpowdn=imp2_powerdown.wav         local
  92.     sound       imppart2loop=imp2_on_loop.wav           local
  93.     sound       imppartright=aet_lightning_02.wav       local
  94.     sound        pow=imp2_activate.wav                    local    # Autoloaded
  95.     sound        put=gen_pistol_put.wav                    local    # Autoloaded
  96.     sound        pull=gen_pistol_pull.wav                local    # Autoloaded
  97.     
  98. # MUSIC
  99.  
  100.     sound       introwav_a=mus_inf_cutscene1a.wav       local
  101.     sound       introwav_b=mus_inf_cutscene1b.wav       local
  102.     sound       introwav_c=mus_teo_statuerise.wav       local
  103.     sound       introwav_d=mus_inf_cutscene1d.wav       local
  104.     sound       introwav_e=mus_inf_cutscene1e.wav       local
  105.     sound       introwav_f=mus_inf_cutscene1f.wav       local
  106.     sound       introwav_g=mus_inf_cutscene1g.wav       local
  107.     
  108. # SFX
  109.  
  110.     sound       cageup=gen_cage_ascend.wav              local
  111.     sound       cagedn=gen_cage_descend.wav             local
  112.     sound       cageloop=gen_cage_loop.wav              local
  113.     sound       cagepwp=gen_cage_powerup.wav            local
  114.     sound       cagesophin=gen_cage_sophia_enter.wav    local
  115.     sound       leverpull=gen_lever_pull.wav            local
  116.  
  117. # ............................... ACTOR THINGS .................................
  118.  
  119.     thing        player                                    local
  120.     thing        indy                                    linkid=0
  121.     thing        sophia
  122.     thing        turner
  123.  
  124. # .............................. OBJECT THINGS .................................
  125.  
  126.     thing        doorbutton
  127.     thing        cageoff                                    nolink
  128.     thing        cage                                    nolink
  129.     thing        controlunit                                nolink
  130.     thing       imppartpos
  131.     thing        coredoor                                nolink
  132.     
  133.     thing       floater0
  134.     thing       floater1
  135.     thing       floater2
  136.     thing       floater3
  137.     thing       floater4
  138.     thing       floater5
  139.     thing       floater6
  140.     thing       floater7
  141.  
  142. # .............................. CAMERA THINGS .................................
  143.  
  144.     thing        cam_1                                    nolink
  145.     thing        cam_2                                    nolink
  146.     thing        cam_3                                    nolink
  147.     thing        cam_4                                    nolink
  148.     thing        cam_5                                    nolink
  149.     thing        cam_6                                    nolink
  150.     thing        cam_7                                    nolink
  151.     thing        cam_8                                    nolink
  152.     thing        cam_9                                    nolink
  153.     thing        cam_10                                    nolink
  154.     thing        cam_11                                    nolink
  155.     thing        cam_12                                    nolink
  156.     thing        cam_13                                    nolink
  157.     thing        cam_14                                    nolink
  158.     thing        cam_15                                    nolink
  159.     thing        cam_16                                    nolink
  160.  
  161.     thing        ct_1                                    nolink
  162.     thing        ct_2                                    nolink
  163.     thing        ct_3                                     nolink
  164.     thing        ct_4                                    nolink
  165.     thing        ct_5                                    nolink
  166.     thing        ct_6                                    nolink
  167.     thing        ct_7                                    nolink
  168.     thing        ct_8                                    nolink
  169.     thing        ct_9                                    nolink
  170.     thing        ct_10                                    nolink
  171.     thing        ct_11                                    nolink
  172.     thing        ct_12                                    nolink
  173.     thing        ct_13                                    nolink
  174.     thing        ct_14                                    nolink
  175.     thing        ct_15                                    nolink
  176.     thing        ct_16                                    nolink
  177.     thing        ct_17                                    nolink
  178.     thing        ct_18                                    nolink
  179.     thing        ct_19                                    nolink
  180.  
  181. # .............................. TARGET THINGS .................................
  182.  
  183.     thing        in_mk_1                                    nolink
  184.     thing        in_mk_2                                    nolink
  185.     thing        in_mk_3                                    nolink
  186.     thing        in_mk_4                                    nolink
  187.     thing        in_mk_5                                    nolink
  188.  
  189.     thing        so_mk_1                                    nolink
  190.     thing        so_mk_2                                    nolink
  191.     thing        so_mk_3                                    nolink
  192.     thing        so_mk_4                                    nolink
  193.     thing        so_mk_5                                    nolink
  194.     thing        so_mk_6                                    nolink
  195.  
  196.     thing        tu_mk_1                                    nolink
  197.     thing        tu_mk_2                                    nolink
  198.     thing        tu_mk_3                                    nolink
  199.     thing        tu_mk_4                                    nolink
  200.     thing        tu_mk_5                                    nolink
  201.     thing        tu_mk_6                                    nolink
  202.     thing        tu_mk_7                                    nolink
  203. #    thing        tu_mk_8                                    nolink
  204.     thing        tu_mk_9                                    nolink
  205.  
  206.     thing        cg_mk_2                                    nolink
  207.  
  208. # ........................ OTHER ENGINE REFERENCES .............................
  209.  
  210.     cog            cagespincog
  211.     cog            sophiaspincog
  212.  
  213.     template    imp2_invis=imp2move                     local
  214.     
  215.     sector      doorsector
  216.     
  217. # ............................... VARIABLES ....................................
  218.     
  219.     vector        v_targetpos                                local
  220.  
  221.     vector        posOffset                                local
  222.     vector        angOffset                                local
  223.     
  224.     flex        in_rotRate                                local
  225.     flex        so_rotRate                                local
  226.     flex        tu_rotRate                                local
  227.  
  228.     int            trapSceneState=0                        local # overall state var
  229.  
  230.     int            in_collType                                local
  231.     int            so_collType                                local
  232.     int            tu_collType                                local
  233.     int            cg_collType                                local
  234.     int            cx_collType                                local
  235.     
  236.     int            in_keyTrack1                            local
  237.     int            in_keyTrack2                            local
  238.     int            so_keyTrack1                            local
  239.     int            tu_keyTrack1                            local
  240.     int            tu_keyTrack2                            local
  241.  
  242.     int            tu_swapItem1                            local
  243.     int            swapevent=0                                local
  244.             
  245.     int            curSound                                local
  246.     int            curCam                                    local
  247.     int            vibe                                    local
  248.     int         curpart                                 local
  249.     int         loopchan                                local    
  250.     int         placechan                               local
  251.     int         co_colltype                             local
  252.     int         fx_channel                              local
  253.     int         loopgcagechan                           local
  254.     int         wepnum=1                                local
  255.     int         lastrand=-1                             local
  256.     int         currand=0                               local
  257.     
  258.     sound       indylineb0=inxj058.wav                  local
  259.     sound       indylineb1=inxj059.wav                  local
  260.     sound       indylineb2=inxj060.wav                  local
  261.     sound       indylineb3=inxj061.wav                  local
  262.     sound       indylineb4=inxj090.wav                  local
  263.     sound       indylineb5=inxj095.wav                  local
  264.     
  265. end
  266.  
  267. # ==============================================================================
  268.  
  269. code
  270.  
  271. # ..............................................................................
  272.  
  273. startup:
  274.  
  275.     # Pointer to Player...
  276.     player = GetLocalPlayerThing();
  277.  
  278.     # Prep...
  279.     curCam = GetCurrentCamera();
  280.     SectorAdjoins(doorsector, 0);
  281.     
  282.     SetThingFlags(indy, 0x80000);
  283.     SetThingFlags(sophia, 0x80000);
  284.     SetThingFlags(turner, 0x80000);
  285.     SetThingFlags(cageoff, 0x80000);
  286.     SetThingFlags(cage, 0x80000);
  287.     AISetCutSceneMode(indy);
  288.     AISetCutSceneMode(sophia);
  289.     AISetCutSceneMode(turner);
  290.     in_rotRate = GetThingMaxRotVel(indy);
  291.     so_rotRate = GetThingMaxRotVel(sophia);
  292.     tu_rotRate = GetThingMaxRotVel(turner);
  293.     in_collType = GetCollideType(indy);
  294.     so_collType = GetCollideType(sophia);
  295.     tu_collType = GetCollideType(turner);
  296.     co_collType = GetCollideType(cageoff);
  297.     cg_collType = GetCollideType(cage);
  298.     cx_collType = GetCollideType(controlunit);
  299.  
  300. return;
  301.  
  302. # ..............................................................................
  303.  
  304. activated:
  305.  
  306.     if ((GetSenderRef() == doorbutton) && (trapSceneState == 0) && (GetCurItem(player) == 0))
  307.     {
  308.         SetThingFlags(floater0, 0x80000);
  309.         SetThingFlags(floater1, 0x80000);
  310.         SetThingFlags(floater2, 0x80000);
  311.         SetThingFlags(floater3, 0x80000);
  312.         SetThingFlags(floater4, 0x80000);
  313.         SetThingFlags(floater5, 0x80000);
  314.         SetThingFlags(floater6, 0x80000);
  315.         SetThingFlags(floater7, 0x80000);
  316.  
  317.         # General prep...
  318.         trapSceneState = 1;
  319.         curCam = GetCurrentCamera();
  320.         While(wepnum !=0)
  321.         {
  322.             wepnum = GetCurWeapon(player);
  323.             DeselectWeaponWait(player);
  324.             DeselectWeapon(player);
  325.         }
  326.         StartCutScene(1); # health meter should fade
  327.         SetActorFlags(player, 0x200000);
  328.         StopThing(player);
  329.         DeselectWeaponWait(player);
  330.         CopyPlayerHolsters(player, indy);
  331.         SetThingflags(player, 0x80000);
  332.         ClearThingFlags(indy, 0x80000);
  333.     
  334.         # Cut to shot of Indy at the door...
  335.         SetCameraLookInterp(2, 0); # no p & t
  336.         SetCameraPosInterp(2, 0); # no dolly
  337.         SetCameraFocus(2, cam_1);
  338.         SetCameraSecondaryFocus(2, ct_1);
  339.         SetCurrentCamera(2);
  340.         SetCameraFOV(90, 0, 0.0);
  341.     
  342.         # Prep Indy, Sophia, Turner, cage & controlunit...
  343.         ClearThingFlags(sophia, 0x80000);
  344.         ClearThingFlags(turner, 0x80000);
  345.         ClearThingFlags(cageoff, 0x80000);
  346.         # ClearThingFlags(cage, 0x80000);
  347.         AISetMoveSpeed(sophia, 1.0);
  348.         AISetMoveSpeed(turner, 1.0);
  349.         SetThingMaxRotVel(sophia, 50.0);
  350.         SetCollideType(indy, 0);
  351.         SetCollideType(sophia, 0);
  352.         SetCollideType(turner, 0);
  353.         SetCollideType(cageoff, 0);
  354.         SetCollideType(cage, 0);
  355.         SetCollideType(controlunit, 0);
  356.         AISetCutSceneMode(sophia);
  357.         AISetCutSceneMode(turner);
  358.         AISetCutSceneMode(cageoff);
  359.         AISetCutSceneMode(cage);
  360.         TeleportThing(turner, tu_mk_1);
  361.         TeleportThing(sophia, so_mk_1);
  362.         AISetLookThingEyeLevel(sophia, so_mk_2);
  363.         AISetLookThingEyeLevel(turner, tu_mk_2);
  364.     
  365.         # Indy pushes button, and door opens...
  366.         PlayKey(indy, in_activate, 4, 0x12, 0);
  367.         Sleep(0.3);
  368.         MoveToFrame(doorbutton, 1, 1.0);
  369.         WaitForStop(doorbutton);        
  370.         SectorAdjoins(doorsector, 1);
  371.         Sleep(0.01);
  372.         MoveToFrame(coredoor, 1, 0.5);
  373.     
  374.         # Swing camera toward core...
  375.         SetCameraInterpSpeed(2, 3.5); # was 1.5
  376.         SetCameraLookInterp(2, 1);
  377.         SetThingMaxRotVel(indy, 100.0);
  378.         Sleep(0.5);
  379.         SetThingMaxRotVel(indy, 100.0);
  380.         AISetLookThingEyeLevel(indy, in_mk_2);
  381.         SetCameraSecondaryFocus(2, ct_2);
  382.         WaitForStop(coredoor);
  383.         
  384.         #music
  385.         PlaySoundLocal(introwav_a, 0.65, 0, 0x0, 0);
  386.     
  387.         # Indy walks into the core...
  388.         AttachThingToThing(cam_1, ct_2);
  389.         AttachThingToThing(ct_2, indy);
  390.         AISetMoveSpeed(indy, 1.0);
  391.         AISetMoveThing(indy, in_mk_1, 0);
  392.         AIWaitForStop(indy);
  393.     
  394.         # Cut to Indy emerging into core...
  395.         DetachThing(cam_1);
  396.         DetachThing(ct_2);
  397.         AttachThingToThing(cam_2, indy);
  398.         SetCameraLookInterp(2, 0);
  399.         SetCameraPosInterp(2, 0);
  400.         SetCameraFocus(2, cam_2);
  401.         SetCameraSecondaryFocus(2, ct_5);
  402.         SetCameraFOV(40, 0, 0.0);
  403.         Sleep(0.01);
  404.         SetCameraFOV(60, 1, 3.0);
  405.     
  406.         # Walk Indy onto the platform...
  407.         AttachThingToThing(ct_5, indy);
  408.         AISetMoveThing(indy, in_mk_2, 0);
  409.         AIWaitForStop(indy);
  410.         DetachThing(cam_2);
  411.     
  412.         # Pan to control unit...
  413.         SetCameraInterpSpeed(2, 12.0);
  414.         SetCameraLookInterp(2, 1);
  415.         SetCameraPosInterp(2, 1);
  416.         in_keyTrack1 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  417.         PlayKey(indy, in_handsTOhips, 4, 0x12, 1);
  418.         PlayKey(indy, in_hatpush, 4, 0x12, 0);
  419.         PlayVoice(indy, in_whistle, 1, 0);
  420.         Sleep(0.5);
  421.         SetCameraFocus(2, cam_3);
  422.         SetCameraSecondaryFocus(2, ct_3);
  423.         SetCameraFOV(110, 1, 3.0);
  424.         Sleep(1.0);
  425.         PlayVoice(indy, in_whathere, 1, 0);
  426.         Sleep(3.0);
  427.         SetCameraFOV(20, 1, 8.0);
  428.         Sleep(3.0);
  429.     
  430.         # Turner and Sophia advance onto platform...
  431.         #music
  432.         PlaySoundLocal(introwav_b, 1, 0, 0x0, 0);
  433.         AISetMoveThing(turner, tu_mk_2, 0);
  434.         Sleep(0.7);
  435.         AISetMoveThing(sophia, so_mk_2, 0);
  436.         Sleep(0.3);
  437.         AISetLookThingEyeLevel(turner, tu_mk_5);
  438.         AISetMoveThing(turner, tu_mk_3, 0);
  439.         Sleep(1.4);
  440.         AISetLookThingEyeLevel(sophia, tu_mk_5);
  441.         Sleep(0.8);
  442.         AISetMoveThing(sophia, so_mk_3, 0);
  443.         Sleep(0.5);
  444.         AISetLookThingEyeLevel(turner, tu_mk_5);
  445.         AISetLookThingEyeLevel(sophia, tu_mk_5);
  446.         Sleep(1.3);
  447.     
  448.         # Cut to close-up of control unit...
  449.         SetCameraLookInterp(2, 0);
  450.         SetCameraPosInterp(2, 0);
  451.         SetCameraFocus(2, cam_4);
  452.         SetCameraSecondaryFocus(2, ct_4);
  453.         SetCameraFOV(30, 0, 0.0);
  454.         TeleportThing(turner, tu_mk_4);
  455.         DetachThing(ct_5);
  456.         
  457.         # Turner's hands insert IMP into receptacle...
  458.         tu_swapItem1 = SetThingMesh(turner, 8, mod_tu_imp2, 0);
  459.         tu_keyTrack1 = PlayKey(turner, tu_handsATside, 2, 0x10, 0);
  460.         swapevent = 1;
  461.         PlayKey(turner, tu_placeimp, 4, 0x12, 0);
  462.         sleep(1);
  463.     
  464.         # IMP2 turns on...
  465.         #SetThingFlags(imp2, 0x80000);
  466.         #ClearThingFlags(imp2_on, 0x80000);
  467.         curpart = CreateThing(imp2_invis, imppartpos);
  468.         CaptureThing(curpart);
  469.         PlaySoundThing(imppartplace, curpart, 1, 10, 20, 0);
  470.         MoveToFrame(curpart, 1, 1);
  471.         WaitForStop(curpart);
  472.         placechan = PlaySoundThing(imppartright, curpart, 1, 10, 20, 0);
  473.         PlaySoundThing(imppartpowup, curpart, 1, 10, 20, 0);
  474.         SetThingModel(curpart, imp2_invis_on);
  475.         WaitForSound(placechan);
  476.         loopchan = PlaySoundThing(imppart2loop, curpart, 1, 4, 10, 1);
  477.         Sleep(0.5);
  478.     
  479.         # Turner's hand pulls lever...
  480.         fx_channel=PlaySoundThing(leverpull, controlunit, 1, 10, 20, 1);
  481.         PlayKey(controlunit, lv_leverpullL, 4, 0x12, 0);
  482.         PlayKey(turner, tu_leverpull, 4, 0x12, 0);
  483.         Sleep(2.5);
  484.         StopSound(fx_channel, 0);
  485.     
  486.         # Cut to zoom up-shot of cage...
  487.         AttachThingToThingEx(ct_6, cage, 0x5000);
  488.         SetCameraFocus(2, cam_5);
  489.         SetCameraSecondaryFocus(2, ct_6);
  490.         SetCameraFOV(90, 0, 0.0);
  491.         Sleep(0.01);
  492.         SetCameraFOV(30, 1, 3.0);
  493.         Sleep(2.0);
  494.     
  495.         # Track descending cage...
  496.         SetPulse(0.1); # camera shake on
  497.         ClearThingFlags(cage, 0x80000);
  498.         fx_channel=PlaySoundThing(cagepwp, cage, 1, 10, 20, 0);
  499.         loopgcagechan=PlaySoundThing(cageloop, cage, 1, 10, 20, 0x0081);
  500.         SetThingAlpha(cage, 0.0);
  501.         ThingFadeAnim(cage, 0.0, 1.0, 1.0, 0);
  502.         ThingFadeAnim(cageoff, 1.0, 0.0, 1.0, 0);
  503.         Sleep(1.0);
  504.         SendMessage(cagespincog, user0); # spin cage...
  505.         DestroyThing(cageoff); # won't see him no more
  506.         SetPulse(0.0); # and off again
  507.         Sleep(1.0);
  508.         SendMessage(cagespincog, user2); # lower cage to middle mark...
  509.         fx_channel=PlaySoundThing(cagedn, cage, 1, 10, 20, 0);
  510.         PlaySoundLocal(introwav_c, 1, 0, 0x0, 0);
  511.         Sleep(0.2);
  512.         SetCameraFOV(75, 1, 4.8);
  513.         Sleep(5.0);
  514.         SetCameraFOV(40, 1, 4.5); # adjust in engine
  515.         Sleep(4.5); # adjust in engine!
  516.     
  517.         # Cut to cage past Turner and Sophia at control unit...
  518.         SetCameraFocus(2, cam_6);
  519.         SetCameraSecondaryFocus(2, ct_7);
  520.         SetCameraFOV(25, 0, 0.0);
  521.         # Sleep(0.5);
  522.     
  523.         # Turner: "Finally!  The new world beckons...we need an ambassador!"
  524.         curSound = PlayVoice(turner, tu_worldbeckons, 1.0, 0);
  525.     
  526.         # Turner futzes...
  527.         AIEnableHeadTracking(turner, cage);
  528.         PlayKey(controlunit, lv_leverfutz, 4, 0x12, 0);
  529.         PlayKey(turner, tu_leverfutz, 4, 0x12, 0);
  530.         Sleep(0.35);
  531.         fx_channel=PlaySoundThing(leverpull, controlunit, 1, 10, 20, 0);
  532.         Sleep(0.35);
  533.             
  534.         AISetLookThingEyeLevel(sophia, so_mk_4);
  535.         AISetMoveThing(sophia, so_mk_4, 0);
  536.         PlayKey(controlunit, lv_leverfutz, 4, 0x12, 0);
  537.         tu_keyTrack2 = PlayKey(turner, tu_leverfutz, 4, 0x12, 0);
  538.         Sleep(0.35);
  539.         fx_channel=PlaySoundThing(leverpull, controlunit, 1, 10, 20, 0);
  540.         Sleep(2);
  541.         AISetLookThing(sophia, cage);
  542.         AIWaitForStop(sophia);
  543.         AIDisableHeadTracking(turner);
  544.     
  545.         # Cut inside cage...
  546.         AttachThingToThing(ct_8, sophia);
  547.         SetCameraFocus(2, cam_7); # inside cage
  548.         SetCameraSecondaryFocus(2, ct_8);
  549.         SetCameraFOV(65, 0, 0.0);
  550.         StopKey(turner, tu_keyTrack1, 0.0);
  551.         StopKey(turner, tu_keyTrack2, 0.0);
  552.     
  553.         # Turner and Sophia approach the cage...
  554.         AIEnableHeadTracking(sophia, so_mk_6); # keep her head low
  555.         AISetMoveThing(sophia, so_mk_5, 0);
  556.         AISetLookThingEyeLevel(turner, so_mk_4);
  557.         AISetMoveThing(turner, so_mk_4, 0);
  558.         Sleep(0.01);
  559.         SetCameraFOV(25, 1, 4.2);
  560.         Sleep(1.0);
  561.         AISetLookThing(turner, so_mk_6);
  562.         AISetMoveThing(turner, tu_mk_6, 0);
  563.         AIWaitForStop(sophia);
  564.         DetachThing(ct_8);
  565.         AIDisableHeadTracking(sophia);
  566.         AIWaitForStop(turner);
  567.         tu_keyTrack1 = PlayKey(turner, tu_handsONhips, 4, 0x10, 0);
  568.         PlayKey(turner, tu_rthand, 4, 0x12, 0);
  569.         WaitForSound(curSound);
  570.         
  571.         # Sophia: "Don't be a fool...I sense...evil force...waiting to destroy us."
  572.         curSound = PlayVoice(sophia, so_dontbefool, 1.0, 0);
  573.         PlayKey(sophia, so_turn, 4, 0x12, 1); # 2-2
  574.         Sleep(0.5);
  575.         PlayKey(sophia, so_lthandup, 4, 0x12, 1); # 2-2
  576.         WaitForSound(curSound);
  577.     
  578.         # Cut to Indy walking into frame...
  579.         SetCameraFocus(2, cam_8);
  580.         SetCameraSecondaryFocus(2, ct_9);
  581.         SetCameraFOV(70, 0, 0.0);
  582.         StopKey(indy, in_keyTrack1, 0.0);
  583.         TeleportThing(indy, in_mk_3);
  584.         AISetLookThing(indy, ct_4); # cheat his look away from camera
  585.         AISetMoveThing(indy, in_mk_4, 0);
  586.         AIWaitForStop(indy);
  587.         
  588.         # Indy: "Hey, you two!"
  589.         PlayKey(indy, in_rtarmup, 4, 0x12, 0);
  590.         Sleep(0.2);
  591.         curSound = PlayVoice(indy, in_heytwo, 1.0, 0);
  592.         StopKey(turner, tu_keyTrack1, 0.5);
  593.         Sleep(0.5);
  594.         WaitForSound(curSound);
  595.     
  596.         # Cut to Turner maneuvering behind Sophia...
  597.         SetCameraFocus(2, cam_9);
  598.         SetCameraSecondaryFocus(2, ct_10);
  599.         SetCameraFOV(35, 0, 0.0);
  600.         
  601.         #so_keyTrack1 = PlayKey(sophia, so_armsFolded, 2, 0x10, 0);
  602.         PlayKey(sophia, so_hair, 4, 0x14, 0); #2-2
  603.  
  604.         AttachThingToThing(ct_10, turner);
  605.         AIEnableHeadTracking(turner, so_mk_6); # cheat his look a bit
  606.         AISetMoveThing(turner, tu_mk_7, 0);
  607.         AIWaitForStop(turner);
  608.         AIDisableHeadTracking(turner);
  609.         
  610.         # Turner: "Jones?!  Stay out of this!"
  611.         curSound = PlayVoice(turner, tu_jonesout, 1.0, 0);
  612.         WaitForSound(curSound);
  613.                        
  614.         # Turner looks toward Sophia...
  615.         AISetLookThingEyeLevel(turner, sophia);
  616.         
  617.         # Turner: "Don't worry...know my limitations...contact with spirit world."
  618.         curSound = PlayVoice(turner, tu_knowlimit, 1.0, 0);
  619.         ## PlayKey(turner, tu_sleeve, 4, 0x12, 0); # TEMP!
  620.         Sleep(1.0);
  621.         WaitForSound(curSound);
  622.     
  623.         # Sophia: "Oh sure.  Do I look that crazy to you?"
  624.         so_keyTrack1 = PlayKey(sophia, so_handsONhips, 2, 0x00, 0);
  625.         #StopKey(sophia, so_keyTrack1, 0.7);
  626.         curSound = PlayVoice(sophia, so_lookcrazy, 1.0, 0);
  627.         Sleep(0.7);
  628.         PlayKey(sophia, so_lookleft, 4, 0x14, 0);
  629.         WaitForSound(curSound);
  630.     
  631.         # Turner: "You look like a real diplomat."
  632.         PlayVoice(turner, tu_lookdiplomat, 1.0, 0);
  633.         Sleep(1.7);
  634.     
  635.         # Turner pushes Sophia into the cage...
  636.         
  637.         # TO DO:  sound effect thump...
  638.         #music
  639.         PlaySoundLocal(introwav_d, 1, 0, 0x0, 0);
  640.         
  641.         PlayKey(turner, tu_pushsophia, 4, 0x12, 0);
  642.         Sleep(0.5);
  643.         StopKey(sophia, so_keyTrack1, 0.0);
  644.         PlayKey(sophia, so_plunge, 4, 0x12, 0);
  645.     
  646.         # Sophia: "Ahhh!"
  647.         curSound = PlayVoice(sophia, so_ahhh, 1.0, 0);
  648.         Sleep(0.8);
  649.         fx_channel=PlaySoundThing(cagesophin, cage, 1, 10, 20, 0);
  650.     
  651.         # TO DO: possibly add a visual effect during pan, maybe a golden flash-bulb
  652.         # as when the young woman appeared.  In any case, need sounds...
  653.     
  654.         # Camera pans to cage...
  655.         SetCameraInterpSpeed(2, 1.0);
  656.         SetCameraLookInterp(2, 1); # ready to pan
  657.         Sleep(0.01);
  658.         SetCameraSecondaryFocus(2, cg_mk_2);
  659.         SetCameraFOV(60, 1, 1.0);
  660.         
  661.         # Prep Sophia for her ordeal...
  662.         # StopKey(sophia, so_keyTrack1);
  663.         ClearPhysicsFlags(sophia, 0x01); # no gravity no more
  664.         TeleportThing(sophia, cg_mk_2); # put her inside
  665.         AttachThingToThingEx(sophia, cage, 0x5000); # in an unbreakable grip
  666.     
  667.         # Spin sophia...
  668.         SendMessage(sophiaspincog, user1); # spin sophia
  669.         WaitForSound(curSound);
  670.         AISetLookThing(indy, turner); # adjust Indy's look offscreen
  671.         Sleep(2.0);
  672.     
  673.         # Cut to wide shot of Indy and Turner...
  674.         SetCameraLookInterp(2, 0);    
  675.         SetCameraFocus(2, cam_10);
  676.         SetCameraSecondaryFocus(2, ct_11);
  677.         SetCameraFOV(38, 0, 0.0);
  678.         Sleep(0.01);
  679.         
  680.         # Turner: "Impressive...gold mine...puzzles...help me solve this one!"
  681.         tu_keyTrack1 = PlayKey(turner, tu_handsONhips, 2, 0x10, 0);
  682.         curSound = PlayVoice(turner, tu_goldminea, 1.0, 0);
  683.         AISetLookThing(turner, indy);
  684.         SetThingMaxHeadVel(indy, 100.0);
  685.         AIEnableHeadTracking(indy, sophia);
  686.         Sleep(2.0);
  687.         AIEnableHeadTracking(indy, turner);
  688.         in_keyTrack1 = PlayKey(indy, in_armsCrossed, 2, 0x10, 0);
  689.         PlayKey(indy, in_crossArms, 4, 0x12, 0);
  690.         Sleep(4.0);
  691.         curSound = PlayVoice(turner, tu_goldmineb, 1.0, 0);
  692.         Sleep(1);
  693.     
  694.         # Cut closer on Turner as he finishes speech...
  695.         SetCameraFocus(2, cam_11);
  696.         SetCameraSecondaryFocus(2, ct_12);
  697.         SetCameraFOV(35, 0, 0.0);
  698.         Sleep(4.0);
  699.         PlayKey(turner, tu_rthand_1_1, 4, 0x12, 0);
  700.         WaitForSound(curSound);
  701.     
  702.         # Cut to single on Indy...
  703.         SetCameraFocus(2, cam_12);
  704.         SetCameraSecondaryFocus(2, ct_13);
  705.         SetCameraFOV(35, 0, 0.0);
  706.         AIDisableHeadTracking(indy);
  707.         
  708.         # Indy: "Why should I help a thief?"
  709.         curSound = PlayVoice(indy, in_whyhelpthief, 1.0, 0);
  710.         in_keyTrack2 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  711.         StopKey(indy, in_keyTrack1, 0.5);
  712.         WaitForSound(curSound);
  713.     
  714.         # Cut back to Turner...
  715.         SetCameraFocus(2, cam_13);
  716.         SetCameraSecondaryFocus(2, ct_14);
  717.         SetCameraFOV(25, 0, 0.0);
  718.         
  719.         # Turner: "In the name of freedom, man!  We're in a war!"
  720.         curSound = PlayVoice(turner, tu_namefreedom, 1.0, 0);
  721.         StopKey(turner, tu_keyTrack1, 0.5);if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  722.         {
  723.             StopThing(player);
  724.             StartCutscene(1);
  725.             SetActorFlags(player, 0x200000);
  726.             currand = RandBetween(0, 5);
  727.             While (lastrand == currand)
  728.             {
  729.                 currand = RandBetween(0, 5);
  730.             }
  731.             PlayVoice(player, indylineb0[currand], 1, 1);
  732.             lastrand = currand;
  733.             EndCutscene();
  734.             ClearActorFlags(player, 0x200000);
  735.         }
  736.         Sleep(0.5);
  737.         PlayKey(turner, tu_botharmsup, 4, 0x12, 0);
  738.         WaitForSound(curSound);
  739.     
  740.         # Cut to Indy and push in...
  741.         SetCameraFocus(2, cam_12);
  742.         SetCameraSecondaryFocus(2, ct_13);
  743.         SetCameraFOV(35, 0, 0.0);
  744.         
  745.         # Indy: "All right...how's this...apply for a grant...study...sure bet."
  746.         curSound = PlayVoice(indy, in_howsthisa, 1.0, 0);
  747.         Sleep(0.01);
  748.         SetCameraInterpSpeed(2, 12.0);
  749.         SetCameraLookInterp(2, 1);
  750.         Sleep(0.01);
  751.         SetCameraSecondaryFocus(2, ct_15);
  752.         SetCameraFOV(20, 1, 12.0);
  753.         StopKey(indy, in_keyTrack2, 0.5);
  754.         Sleep(1.0);
  755.         PlayKey(indy, in_stop, 4, 0x12, 0);
  756.         Sleep(3.0);
  757.         PlayKey(indy, in_rtarmup, 4, 0x12, 0);
  758.         Sleep(3);
  759.         WaitForSound(curSound);
  760.         curSound = PlayVoice(indy, in_howsthisb, 1.0, 0);
  761.         sleep(1);
  762.         PlayKey(indy, in_botharmsup, 4, 0x12, 0);
  763.         //Sleep(1.0);
  764.         WaitForSound(curSound);
  765.         
  766.         # Cut to Turner...
  767.         SetCameraLookInterp(2, 0);
  768.         SetCameraFocus(2, cam_13);
  769.         SetCameraSecondaryFocus(2, ct_14);
  770.         SetCameraFOV(30, 0, 0.0);
  771.         
  772.         # Turner: "Forget your ivory-tower, Jones...save democracy!"
  773.         curSound = PlayVoice(turner, tu_forgetivory, 1.0, 0);
  774.         SetThingMaxRotVel(turner, 500.0);
  775.         PlayKey(turner, tu_sleeve, 4, 0x12, 1);
  776.         AISetLookThingEyeLevel(turner, so_mk_3);
  777.         AIWaitForStop(turner);
  778.         AISetMoveThing(turner, so_mk_3, 0);
  779.         Sleep(2.0);
  780.         WaitForSound(curSound);
  781.     
  782.         # Cut back to Indy...
  783.         SetCameraFocus(2, cam_12);
  784.         SetCameraSecondaryFocus(2, ct_15);
  785.         SetCameraFOV(20, 0, 0.0);
  786.         
  787.         # Indy: "Let's vote on it!"
  788.         curSound = PlayVoice(indy, in_letsvote, 1.0, 0);
  789.         swapevent = 2; # see callback
  790.         in_keyTrack1 = PlayKey(indy, in_gunout, 4, 0x14, 0);
  791.         Sleep(0.5);
  792.         
  793.         # TO DO: cause pistol to disappear from holster...
  794.     
  795.         WaitForSound(curSound);
  796.     
  797.         # Cut to Turner pulling levers...
  798.         SetCameraFocus(2, cam_14);
  799.         SetCameraSecondaryFocus(2, ct_16);
  800.         SetCameraFOV(35, 0, 0.0);
  801.         StopThing(turner);
  802.         TeleportThing(turner, tu_mk_4);
  803.         PlayKey(controlunit, lv_leverfutz, 4, 0x12, 0);
  804.         PlayKey(turner, tu_leverfutz, 4, 0x12, 0);
  805.         Sleep(0.35);
  806.         fx_channel=PlaySoundThing(leverpull, controlunit, 1, 10, 20, 0);
  807.         Sleep(2.0);
  808.     
  809.         # Track cage ascending into upper barrel of the machine...
  810.         #music
  811.         PlaySoundLocal(introwav_e, 1, 0, 0x0, 0);
  812.         SetCameraFocus(2, cam_5);
  813.         SetCameraSecondaryFocus(2, ct_6);
  814.         SetCameraFOV(20, 0, 0.0);
  815.         Sleep(0.01);
  816.         SendMessage(cagespincog, user1); # raise cage to upper mark
  817.         fx_channel=PlaySoundThing(cageup, cage, 1, 10, 20, 0);
  818.         SetCameraFOV(55, 1, 5.0);
  819.         Sleep(1.0);
  820.         
  821.         # Sophia: "Nooo!"
  822.         PlayVoice(sophia, so_nooo, 1.0, 0);
  823.     
  824.         # Continue tracking cage...
  825.         Sleep(4.0);
  826.         SetCameraFOV(50, 1, 5.0);
  827.         Sleep(5.0);
  828.     
  829.         # Cut back to Turner...
  830.         SetCameraFocus(2, cam_14);
  831.         SetCameraSecondaryFocus(2, ct_19);
  832.         SetCameraFOV(35, 0, 0.0);
  833.         SetCameraInterpSpeed(2, 2.5);
  834.         SetCameraLookInterp(2, 1);
  835.         AISetLookThing(turner, curpart);
  836.         Sleep(0.01);
  837.         SetCameraFOV(30, 1, 2.0);
  838.     
  839.         # Turner grabs the IMP and retreats...
  840.         #SetThingFlags(imp2_on, 0x80000);
  841.         #ClearThingFlags(imp2, 0x80000);
  842.         StopSound(loopchan, 0.25);
  843.         Sleep(0.5);
  844.         swapevent = 3; # see callback
  845.         PlayKey(turner, tu_placeimp, 4, 0x12, 0);
  846.         sleep(1);
  847.         PlaySoundThing(imppartplace, curpart, 1, 10, 20, 0);
  848.         PlaySoundThing(imppartpowdn, curpart, 1, 10, 20, 0);
  849.         Sleep(0.2);
  850.         DestroyThing(curpart);
  851.         AISetMoveSpeed(turner, 1.0);
  852.         AISetLookThingEyeLevel(turner, tu_mk_9);
  853.         AIWaitForStop(turner);
  854.         AISetMoveSpeed(turner, 1.3);
  855.         AISetMoveThing(turner, tu_mk_9, 0);
  856.         SetCameraSecondaryFocus(2, ct_17);
  857.         SetCameraFOV(35, 1, 2.5);
  858.         Sleep(1.0);
  859.     
  860.         # Indy Voice: "Turner!  Come back here!"
  861.         curSound = PlayVoice(indy, in_comeback, 1.0, 0);            
  862.         AIWaitForStop(turner);    
  863.     
  864.         # Turner faces Indy...
  865.         AISetLookThing(turner, indy);
  866.         AIWaitForStop(turner);
  867.         WaitForSound(curSound);
  868.     
  869.         # Turner: "See you later, Jones!"
  870.         curSound = PlayVoice(turner, tu_seeyoulater, 1.0, 0);    
  871.         WaitForSound(curSound);
  872.     
  873.         # Turner raises the IMP and disappears...
  874.         
  875.         # TO DO:  add anim, turn IMP on, add visual effect for Turner...
  876.     
  877.         PlayKey(turner, tu_placeimp, 4, 0x12, 0);
  878.         ThingFadeAnim(turner, 1.0, 0.0, 1.0, 0);
  879.         MakeFairyDust(turner, GetThingJointPos(turner, 5));
  880.         PlaySoundThing(pow, turner, 1, 10, 20, 0);
  881.         Sleep(0.5);
  882.         MakeFairyDust(turner, GetThingJointPos(turner, 5));
  883.         Sleep(0.5);
  884.         MakeFairyDust(turner, GetThingJointPos(turner, 5));
  885.         SetThingFlags(turner, 0x80000);
  886.     
  887.         # Cut to Indy...
  888.         
  889.         SetCameraLookInterp(2, 0);
  890.         SetCameraFocus(2, cam_12);
  891.         SetCameraSecondaryFocus(2, ct_15);
  892.         SetCameraFOV(20, 0, 0.0);
  893.         Sleep(1.0);    
  894.         swapevent = 4;
  895.         StopKey(indy, in_keyTrack1, 0.0);
  896.         PlayKey(indy, in_gunaway, 4, 0x12, 1);
  897.     
  898.         # TO DO: replace gun in holster...
  899.     
  900.         SetThingMaxHeadVel(indy, 50.0);
  901.         Sleep(0.01);
  902.         AIEnableHeadTracking(indy, sophia);
  903.         AISetLookThing(indy, sophia);
  904.         Sleep(1.0);
  905.         in_keyTrack1 = PlayKey(indy, in_handsONhips, 2, 0x10, 0);
  906.         PlayKey(indy, in_handsTOhips, 4, 0x12, 1);
  907.         Sleep(0.2);
  908.     
  909.         # Cut to cage and Sophia...
  910.         SetCameraFocus(2, cam_5);
  911.         SetCameraSecondaryFocus(2, ct_6);
  912.         SetCameraFOV(50, 0, 0.0);
  913.         Sleep(0.01);
  914.         SetCameraFOV(20, 1, 3.0);
  915.     
  916.         # Sophia: "Indeee!"
  917.         PlayVoice(sophia, so_indeee, 0.7, 0);    
  918.         Sleep(3.0);
  919.     
  920.         # Cut to down angle on Indy...
  921.         SetCameraFocus(2, cam_15);
  922.         SetCameraSecondaryFocus(2, indy);
  923.         SetCameraFOV(35, 0, 0.0);
  924.         
  925.         # Indy: "Don't worry, Sophia, I'll think of something!"
  926.         PlayVoice(indy, in_dontworry, 1.0, 0);
  927.         SetCameraInterpSpeed(2, 3.0);
  928.         SetCameraLookInterp(2, 1);
  929.         SetCameraPosInterp(2, 1);
  930.         Sleep(0.01);
  931.     
  932.         # Crane down to closer...    
  933.         SetThingMaxHeadVel(indy, 200.0);
  934.         SetCameraFocus(2, cam_16);
  935.         SetCameraSecondaryFocus(2, ct_18);
  936.         SetCameraFOV(25, 1, 3.0);
  937.         Sleep(2.5);
  938.         AIEnableHeadTracking(indy, in_mk_5);
  939.         AISetLookThing(indy, in_mk_5);
  940.         Sleep(0.7);
  941.         
  942.         # Indy: "I hope."
  943.         PlayVoice(indy, in_ihope, 0.7, 0);
  944.         Sleep(0.5);
  945.         in_keyTrack2 = PlayKey(indy, in_hatpush, 4, 0x12, 0);
  946.         #music
  947.         PlaySoundLocal(introwav_f, 1, 0, 0x0, 0);
  948.     
  949.         # TO DO: swap in Indy's good hair head during hat move...
  950.     
  951.         Sleep(1.5);
  952.         StopKey(indy, in_keyTrack1, 0.5);
  953.         StopKey(indy, in_keyTrack2, 0.5);
  954.         Sleep(0.5);
  955.     
  956.         # Prep follow-cam...
  957.         v_targetpos = GetThingPos(cam_8);
  958.         SetCameraPosition(1, v_targetpos); # prep
  959.         Sleep(0.1);
  960.         WaitForSound(curSound);
  961.     
  962.         # Clean-up & restore control...
  963.         AIDisableHeadTracking(indy);
  964.         SetThingFlags(indy, 0x80000);
  965.         ClearThingFlags(player, 0x80000);
  966.         #SetCollideType(cage, cg_collType);
  967.         SetCollideType(controlunit, cx_collType);
  968.         SetCameraLookInterp(2, 0);
  969.         SetCameraPosInterp(2, 0);
  970.         CopyOrientAndPos(indy, player);
  971.         ClearActorFlags(player, 0x200000);
  972.         SetCurrentCamera(curCam);
  973.         ResetCameraFOV(0, 0.0);
  974.     
  975.         EndCutScene();
  976.         #music
  977.         //PlaySoundLocal(introwav_g, 1, 0, 0x0, 0);
  978.         
  979.         MoveToFrame(coredoor, 0, 2);
  980.         WaitForStop(coredoor);
  981.         SectorAdjoins(doorsector, 0);
  982.         trapSceneState = 2; # close the iron door on this scene
  983.         wepnum = 1;
  984.         Sleep(3);
  985.         
  986.         ClearThingFlags(floater0, 0x80000);
  987.         ClearThingFlags(floater1, 0x80000);
  988.         ClearThingFlags(floater2, 0x80000);
  989.         ClearThingFlags(floater3, 0x80000);
  990.         ClearThingFlags(floater4, 0x80000);
  991.         ClearThingFlags(floater5, 0x80000);
  992.         ClearThingFlags(floater6, 0x80000);
  993.         ClearThingFlags(floater7, 0x80000);
  994.         
  995.         return;
  996.     }
  997.     
  998.     if ((GetCurItem(player) != 0) && (GetSenderID() == 1))
  999.     {
  1000.         StopThing(player);
  1001.         StartCutscene(1);
  1002.         SetActorFlags(player, 0x200000);
  1003.         currand = RandBetween(0, 5);
  1004.         While (lastrand == currand)
  1005.         {
  1006.             currand = RandBetween(0, 5);
  1007.         }
  1008.         PlayVoice(player, indylineb0[currand], 1, 1);
  1009.         lastrand = currand;
  1010.         EndCutscene();
  1011.         ClearActorFlags(player, 0x200000);
  1012.     }
  1013.     return;
  1014.  
  1015. # ..............................................................................
  1016.  
  1017. callback:
  1018.  
  1019.     # Only listen for callbacks while this cog's scene is running...
  1020.     if (trapSceneState != 1)
  1021.     {
  1022.         return;
  1023.     }    
  1024.     
  1025.     if (swapevent == 1)
  1026.     {
  1027.         # Turner leaves IMP in socket...
  1028.         RestoreThingMesh(turner, tu_swapItem1);
  1029.         #ClearThingFlags(imp2, 0x80000);
  1030.         swapevent = 0; # reset
  1031.     }
  1032.  
  1033.     if (swapevent == 2)
  1034.     {
  1035.         # Indy pulls revolver...
  1036.         ResetHolsterModel(indy, 2);
  1037.         PlaySoundThing(pull, indy, 1, -1, -1, 0x80);
  1038.         SetWeaponModel(indy, GetLastPistol(player));
  1039.         #in_swapItem1 = SetThingMesh(indy, 15, mod_in_gun, 0);
  1040.         #print("DONT FORGET TO COMMENT THIS OUT RANDYS FIX !!!!!");
  1041.         swapevent = 0;
  1042.     }
  1043.     
  1044.     if (swapevent == 3)
  1045.     {
  1046.         # Turner grabs IMP from socket...
  1047.         tu_swapItem1 = SetThingMesh(turner, 5, mod_tu_imp2RT, 0);
  1048.         #SetThingFlags(imp2, 0x80000);
  1049.         swapevent = 0;
  1050.     }
  1051.  
  1052.     if (swapevent == 4)
  1053.     {
  1054.         # Indy holsters revolver...
  1055.         SetHolsterModel(indy, GetLastPistol(player), 17);
  1056.         PlaySoundThing(put, indy, 1, -1, -1, 0x80);
  1057.         ResetWeaponModel(indy);
  1058.         swapevent = 0;
  1059.     }
  1060.         
  1061.     return;
  1062.  
  1063. # ..............................................................................
  1064.  
  1065. pulse:
  1066.  
  1067.     vibe = RandBetween(1, 4);
  1068.     if (vibe == 1)
  1069.     {
  1070.         posOffset = '-0.005 0.00 -0.002';
  1071.         angOffset = '0.00 -0.002 0.002';
  1072.     }
  1073.     if (vibe == 2)
  1074.     {
  1075.         posOffset = '0.005 -0.005 0.002';
  1076.         angOffset = '0.002 0.00 -0.002';
  1077.     }
  1078.     if (vibe == 3)
  1079.     {
  1080.         posOffset = '0.002 0.005 -0.005';
  1081.         angOffset = '-0.002 0.002 -0.002';
  1082.     }
  1083.     if (vibe == 4)
  1084.     {
  1085.         posOffset = '-0.002 0.00 0.005';
  1086.         angOffset = '0.00 0.00 0.002';
  1087.     }
  1088.  
  1089.     SetPOVShake(posOffSet, angOffSet, 200.0, 200.0);
  1090.  
  1091.     return;
  1092.  
  1093. end
  1094.